export const insertionSort = (arr) => {
    for (let i = 0; i < arr.length; i++) {

        for (let j = i; j - 1 >= 0; j--) {

            if (arr[j] < arr[j - 1]) {
                const tmp = arr[j]
                arr[j] = arr[j - 1]
                arr[j - 1] = tmp

            } else {
                break
            }
        }
    }

    return arr
}